import http from '@/utils/http'


//获取列表
export function getGoodsListApi() {
    return http({
        url: `/goods/list`,
        method: 'get',
    })
}
//添加
export function addGoodsApi(data) {
    return http({
        url: `/goods/add`,
        method: 'post',
        data,
    })
}

//根据id获取
export function getGoodsInfoByIdApi(id) {
    return http({
        url: '/goods/info/'+id,
        method: 'get',
    })
}

//根据id修改
export function updateGoodsInfoApi(data) {
    return http({
        url: `/goods/update`,
        method: 'put',
        data: data
    })
}

//根据id删除
export function deleteGoodsByIdApi(id) {
    return http({
        url: '/goods/delete/'+id,
        method: 'delete',
    })
}
